var stepId = $CertusJsonAjax.getStepInstanceId();
var processId = $CertusJsonAjax.getProInstanceId();
$CertusFormAjax.ajax('findMgLoans',{"processId":processId},function (response) {
    var data = response.data.datamain;
    $$scope.id = data.id;
    $$scope.companyName = data.companyName;
    $$scope.proName = data.proName;
    $$scope.contractId = data.contractId;
    $$scope.operaterName = data.operaterName;
    $$scope.createTime = data.createTime;
    $$scope.loanComments = data.loanComments;
    $$scope.persons = response.data.persons;
});

$(".agree").on('click',function () {
    $CertusFormAjax.ajax('qyAgreeLoan',{"id":$$scope.id,"stepId":stepId,
        "optionMsg":$("#optionMsg").val(),"processId":processId},function () {
        layer.msg("审批成功！");
        window.history.back();
    });
});
$(".unagree").on('click',function () {
    $CertusFormAjax.ajax('unagreeLoan',{"id":$$scope.id,"stepId":stepId,
        "optionMsg":$("#optionMsg").val(),"processId":processId},function () {
        layer.msg("审批成功！");
        window.history.back();
    });
});